﻿using System;

namespace AiFrame.InterfaceLib.Data.Patterns
{
    /// <summary>
    /// Represents a class that fires events when the object's contents
    /// have changed.
    /// </summary>
    public interface IObservable
    {
        /// <summary>
        /// Notifies the obsesvers.
        /// </summary>
        /// <param name="obj">A object.</param>
        void NotifyObservers(Object obj);

        /// <summary>
        /// Registers a observers.
        /// </summary>
        /// <param name="obs">The observer.</param>
        void RegisterObserver(IObserver obs);

        /// <summary>
        /// Unregisters a observer.
        /// </summary>
        /// <param name="obs">The observer.</param>
        void UnregisterObserver(IObserver obs);

        /// <summary>
        /// Begins the update process. During an update process 
        /// no events are fired when contents are changed.
        /// </summary>
        void BeginUpdate();

        /// <summary>
        /// Ends the update process.
        /// </summary>
        void EndUpdate();
    }
}